package com.billy.ohos.loadingstatusview;

import com.billy.ohos.loadingstatusview.util.AbilityUtil;
import com.billy.ohos.loadingstatusview.wrapability.WrapAbilityAbility;
import com.billy.ohos.loadingstatusview.wrapcomponent.WrapComponentAbility;
import com.billy.ohos.loadingstatusview.wrapslice.WrapSliceAbility;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;

/**
 * demo for Gloading
 * Notice: pictures in this app are get from: https://www.thiswaifudoesnotexist.net/
 */
public class MainAbility extends Ability {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        setUIContent(ResourceTable.Layout_ability_main);

        findComponentById(ResourceTable.Id_btn_wrap_ability).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                AbilityUtil.startAbility(MainAbility.this, WrapAbilityAbility.class);
            }
        });
        findComponentById(ResourceTable.Id_btn_wrap_component).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                AbilityUtil.startAbility(MainAbility.this, WrapComponentAbility.class);
            }
        });
        findComponentById(ResourceTable.Id_btn_wrap_slice).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                AbilityUtil.startAbility(MainAbility.this, WrapSliceAbility.class);
            }
        });

    }
}
